import CustomToast from '../components/custom-toast'

export const showSuccessToast = (content, duration = 2000) => {
  CustomToast.success(content, duration)
}

export const showErrorToast = (content, duration = 2000) => {
  CustomToast.error(content, duration)
}

export const showToast = (options) => {
  const duration = options.duration || 2000
  
  if (options.icon === 'success') {
    CustomToast.success(options.content, duration)
  } else if (options.icon === 'fail' || options.type === 'error') {
    CustomToast.error(options.content, duration)
  } else {
    // 默认作为成功提示处理
    CustomToast.success(options.content, duration)
  }
}

// 兼容原有的Toast.show调用方式
export const Toast = {
  show: showToast
}
